<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>Nordic Thingy:52 v2.2.0 : Thingy Sound Service</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet_offline.css" rel="stylesheet" type="text/css"/>
<link href="nordic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" width="100%" class="blank">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Nordic Semiconductor" src="nordic_small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Nordic Thingy:52 v2.2.0
   </div>
  </td>
 </tr>
 </tbody>
</table>
<script>
var url=window.location.href.split("/").reverse()[1];
var validLinks= ["nrf5","s130","s132","s212","s332"];
var index;
for (index = 0; index < validLinks.length; ++index) {
   if ( url.indexOf(validLinks[index]) !== -1 ) {
      document.getElementById(validLinks[index]).setAttribute('class', 'doclinks docselected');
   };
};
</script>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__ble__srv__tss.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Thingy Sound Service<div class="ingroups"><a class="el" href="group__ble__sdk__srv.html">BLE services</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Thingy Sound Service implementation.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__tss__init__t.html">ble_tss_init_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thingy Sound Service initialization structure.  <a href="structble__tss__init__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__tss__s.html">ble_tss_s</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thingy Sound Service structure.  <a href="structble__tss__s.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga01ccdfec98d9345ac7ec9d35fd186a74"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__srv__tss.html#ga01ccdfec98d9345ac7ec9d35fd186a74">BLE_TSS_MAX_DATA_LEN</a>&#160;&#160;&#160;(BLE_GATT_ATT_MTU_DEFAULT - 3)</td></tr>
<tr class="separator:ga01ccdfec98d9345ac7ec9d35fd186a74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga97ea4228f5ce9f33036b451a21dd7d4e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__srv__tss.html#ga97ea4228f5ce9f33036b451a21dd7d4e">BLE_UUID_TSS_SERVICE</a>&#160;&#160;&#160;0x0500</td></tr>
<tr class="separator:ga97ea4228f5ce9f33036b451a21dd7d4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gac063250d7d8dd0c55073c747306eb452"><td class="memItemLeft" align="right" valign="top"><a id="gac063250d7d8dd0c55073c747306eb452"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__srv__tss.html#gac063250d7d8dd0c55073c747306eb452">ble_tss_evt_handler_t</a>) (<a class="el" href="structble__tss__s.html">ble_tss_t</a> *p_tss, ble_tss_evt_type_t evt_type, uint8_t *p_data, uint16_t length)</td></tr>
<tr class="memdesc:gac063250d7d8dd0c55073c747306eb452"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thingy Sound Service event handler type. <br /></td></tr>
<tr class="separator:gac063250d7d8dd0c55073c747306eb452"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga3cad4a25955b00dc99b931dd37f91d77"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__srv__tss.html#ga3cad4a25955b00dc99b931dd37f91d77">ble_tss_init</a> (<a class="el" href="structble__tss__s.html">ble_tss_t</a> *p_tss, const <a class="el" href="structble__tss__init__t.html">ble_tss_init_t</a> *p_tss_init)</td></tr>
<tr class="memdesc:ga3cad4a25955b00dc99b931dd37f91d77"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for initializing the Thingy Sound Service.  <a href="#ga3cad4a25955b00dc99b931dd37f91d77">More...</a><br /></td></tr>
<tr class="separator:ga3cad4a25955b00dc99b931dd37f91d77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga01ca54da607d250e6f113c35f3c66614"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__srv__tss.html#ga01ca54da607d250e6f113c35f3c66614">ble_tss_mic_set</a> (<a class="el" href="structble__tss__s.html">ble_tss_t</a> *p_tss, uint8_t *p_data, uint16_t size)</td></tr>
<tr class="memdesc:ga01ca54da607d250e6f113c35f3c66614"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for sending microphone data.  <a href="#ga01ca54da607d250e6f113c35f3c66614">More...</a><br /></td></tr>
<tr class="separator:ga01ca54da607d250e6f113c35f3c66614"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeab153e0eed3564e841c3bd9fda47962"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__srv__tss.html#gaeab153e0eed3564e841c3bd9fda47962">ble_tss_on_ble_evt</a> (<a class="el" href="structble__tss__s.html">ble_tss_t</a> *p_tss, ble_evt_t *p_ble_evt)</td></tr>
<tr class="memdesc:gaeab153e0eed3564e841c3bd9fda47962"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for handling the Thingy Sound Service's BLE events.  <a href="#gaeab153e0eed3564e841c3bd9fda47962">More...</a><br /></td></tr>
<tr class="separator:gaeab153e0eed3564e841c3bd9fda47962"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafcc18b076ebbd36ae893ae8291e9ca8f"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__srv__tss.html#gafcc18b076ebbd36ae893ae8291e9ca8f">ble_tss_spkr_stat_set</a> (<a class="el" href="structble__tss__s.html">ble_tss_t</a> *p_tss, ble_tss_spkr_stat_t status)</td></tr>
<tr class="memdesc:gafcc18b076ebbd36ae893ae8291e9ca8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for sending speaker status.  <a href="#gafcc18b076ebbd36ae893ae8291e9ca8f">More...</a><br /></td></tr>
<tr class="separator:gafcc18b076ebbd36ae893ae8291e9ca8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Thingy Sound Service implementation. </p>
<p>The Thingy Sound Service is a simple GATT-based service with multiple characteristics for reading sensor data and configuring the sensors.</p>
<dl class="section note"><dt>Note</dt><dd>The application must propagate S110 SoftDevice events to the Thingy Sound Service module by calling the <a class="el" href="group__ble__srv__tss.html#gaeab153e0eed3564e841c3bd9fda47962" title="Function for handling the Thingy Sound Service&#39;s BLE events. ">ble_tss_on_ble_evt()</a> function from the ble_stack_handler callback. </dd></dl>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga01ccdfec98d9345ac7ec9d35fd186a74"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga01ccdfec98d9345ac7ec9d35fd186a74">&#9670;&nbsp;</a></span>BLE_TSS_MAX_DATA_LEN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BLE_TSS_MAX_DATA_LEN&#160;&#160;&#160;(BLE_GATT_ATT_MTU_DEFAULT - 3)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Maximum length of data (in bytss) that can be transmitted to the peer by the Thingy Sound service module. </p>

</div>
</div>
<a id="ga97ea4228f5ce9f33036b451a21dd7d4e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga97ea4228f5ce9f33036b451a21dd7d4e">&#9670;&nbsp;</a></span>BLE_UUID_TSS_SERVICE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BLE_UUID_TSS_SERVICE&#160;&#160;&#160;0x0500</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The UUID of the Thingy Sound Service. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga3cad4a25955b00dc99b931dd37f91d77"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3cad4a25955b00dc99b931dd37f91d77">&#9670;&nbsp;</a></span>ble_tss_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_tss_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structble__tss__s.html">ble_tss_t</a> *&#160;</td>
          <td class="paramname"><em>p_tss</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structble__tss__init__t.html">ble_tss_init_t</a> *&#160;</td>
          <td class="paramname"><em>p_tss_init</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for initializing the Thingy Sound Service. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">p_tss</td><td>Thingy Sound Service structure. This structure must be supplied by the application. It is initialized by this function and will later be used to identify this particular service instance. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_tss_init</td><td>Information needed to initialize the service.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">NRF_SUCCESS</td><td>If the service was successfully initialized. Otherwise, an error code is returned. </td></tr>
    <tr><td class="paramname">NRF_ERROR_NULL</td><td>If either of the pointers p_tss or p_tss_init is NULL. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga01ca54da607d250e6f113c35f3c66614"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga01ca54da607d250e6f113c35f3c66614">&#9670;&nbsp;</a></span>ble_tss_mic_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_tss_mic_set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structble__tss__s.html">ble_tss_t</a> *&#160;</td>
          <td class="paramname"><em>p_tss</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for sending microphone data. </p>
<p>This function sends the microphone input as an microphone characteristic notification to the peer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_tss</td><td>Pointer to the Thingy Sound Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_data</td><td>Pointer to the mic data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Mic data size.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">NRF_SUCCESS</td><td>If the string was sent successfully. Otherwise, an error code is returned. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaeab153e0eed3564e841c3bd9fda47962"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeab153e0eed3564e841c3bd9fda47962">&#9670;&nbsp;</a></span>ble_tss_on_ble_evt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ble_tss_on_ble_evt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structble__tss__s.html">ble_tss_t</a> *&#160;</td>
          <td class="paramname"><em>p_tss</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ble_evt_t *&#160;</td>
          <td class="paramname"><em>p_ble_evt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for handling the Thingy Sound Service's BLE events. </p>
<p>The Thingy Sound Service expects the application to call this function each time an event is received from the S110 SoftDevice. This function processes the event if it is relevant and calls the Thingy Sound Service event handler of the application if necessary.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_tss</td><td>Thingy Sound Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_ble_evt</td><td>Event received from the S110 SoftDevice. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gafcc18b076ebbd36ae893ae8291e9ca8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafcc18b076ebbd36ae893ae8291e9ca8f">&#9670;&nbsp;</a></span>ble_tss_spkr_stat_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_tss_spkr_stat_set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structble__tss__s.html">ble_tss_t</a> *&#160;</td>
          <td class="paramname"><em>p_tss</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ble_tss_spkr_stat_t&#160;</td>
          <td class="paramname"><em>status</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for sending speaker status. </p>
<p>This function sends the speaker status as an speaker status characteristic notification to the peer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_tss</td><td>Pointer to the Thingy Sound Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">status</td><td>The status.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">NRF_SUCCESS</td><td>If the string was sent successfully. Otherwise, an error code is returned. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="topicfooter">
<a href="mailto:docfeedback@nordicsemi.no?subject=Documentation%20feedback" id="maillink">Documentation feedback</a> | <a href="https://devzone.nordicsemi.com/questions/" target="_blank">Developer Zone</a> | <a href="http://response.nordicsemi.com/subscribe-to-our-newsletters" target="_blank">Subscribe</a> | Updated <span id="date"/>
<script>
var date = new Date("Thu Feb 7 2019" + " UTC");
document.getElementById("date").innerHTML = date.toJSON().slice(0, 10);
var url=window.location.href.split("?")[0];
var filename=url.substring(url.lastIndexOf('/')+1);
document.getElementById("maillink").href = "mailto:docfeedback@nordicsemi.no?subject=Documentation%20feedback"+decodeURIComponent("%26")+"body=File%20name%3A%20"+encodeURIComponent(filename);
</script>
</div>
</body>
</html>
